const {contextBridge, ipcRenderer} = require('electron')

const openMessageBox = args => {
    return ipcRenderer.send('messageBox-event', args)
}

const changeFontSize = (callback) => ipcRenderer.on('change-font-size', callback)

// 将预定义的 API 方法暴露给窗口的渲染进程
contextBridge.exposeInMainWorld('api', {
    openMessageBox,
    changeFontSize
})
